package com.acdc.mqtt.entity;

import com.fasterxml.jackson.annotation.JsonValue;

public enum ControlType {
    OTA("ota"),
    UT("ut"),
    FILE("file"),
    DATE_TIME("dateTime"),
    KJ("kj");

    private String type;
    ControlType(String type) {
        this.type = type;
    }

    @JsonValue
    public String getType() {
        return type;   
    }

    public static ControlType getControlType(String type) {
        for (ControlType controlType : ControlType.values()) {
            if (controlType.getType().equals(type)) {
                return controlType;
            }
        }
        return null;
    }
}
